import { sendSipData, sipInsert, sipUpdate, sipStaus } from "@/api/sip";
import { Notification } from "element-ui";
//封装查询sip状态请求
export const getcheck = async () => {
  // 开启检测消息
  let infMsg = Notification({
    title: "消息",
    message: "开始检测sip状态",
    duration: 0,
  });
  // 编辑成功需要刷新sip状态
  const res = await sipStaus();
  // 检测成功
  if (res.data.status_code === 0) {
    // 关闭消息
    infMsg.close();
    // 提示成功
    Notification({
      title: "sip检测",
      message: "sip检测成功",
      type: "success",
    });
  }
  // 检测失败
  if (res.data.status_code === 2) {
    Notification({
      title: "sip检测",
      message: "sip检测失败",
    });
  }
};
